#include <iostream>
#include <cmath>
#include <string>
using namespace std;

long long change(string s)
{
	for (int i = s.size() - 2; i >= 0; i--)
	{
		s += s[i];
	}
	return stol(s);
}
bool isprim(long long x)
{
	if (x <= 1) return false;
	for (long long i = 2; i <= sqrt(x); i++)
	{
		if (x % i == 0) return false;
	}
	return true;
}
int main()
{
	string s;
	cin >> s;
	long long x = change(s);
	if (isprim(x)) cout << "prime" << endl;
	else cout << "noprime" << endl;
	return 0;
}